package com.chatplus.application.aiprocessor.constant;

import com.chatplus.application.enumeration.AiPlatformEnum;
import com.chatplus.application.enumeration.ImgAiPlatformEnum;

/**
 * AI常量
 */
public class AIConstants {

    private AIConstants() {
    }
    public static final String ERROR_MSG = "抱歉，AI 助手开小差了，请稍后再试。";
    public static final String ERR_IMG = "![](/images/wx.png)";

    public static final String SYSTEM_CONFIG_REDIS_KEY = "ai_system_config";
    public static final String CHAT_CONFIG_REDIS_KEY = "ai_chat_config";
    /**
     * 以下参数不要随便改，如果自定义有url的话也要参考以下参数
     */
    public static class  DefaultBaseUrl{
        private DefaultBaseUrl() {
        }
        public static final String AZURE = "https://chat-bot-api.openai.azure.com/openai/deployments/{model}/chat/completions?api-version=2023-05-15";
        public static final String BAI_DU = "https://aip.baidubce.com/rpc/2.0/ai_custom/";
        public static final String CHAT_GLM = "https://open.bigmodel.cn/";
        public static final String DALL_API_URL = "http://89.117.18.9:8001/v1/images/generations";
        public static final String OPEN_AI = "https://api.chatanywhere.com.cn/v1/chat/completions";

        public static final String XUN_FEI = "https://spark-api.xf-yun.com/{version}/chat";

        public static String getDefaultBaseUrlByChannel(AiPlatformEnum channel) {
            return switch (channel) {
                case AZURE -> AZURE;
                case BAI_DU -> BAI_DU;
                case CHAT_GLM -> CHAT_GLM;
                case OPEN_AI -> OPEN_AI;
                case XUN_FEI -> XUN_FEI;
            };
        }
        public static String getDefaultBaseUrlByIMGChannel(ImgAiPlatformEnum channel) {
            return switch (channel) {
                case DALL_E_3 -> OPEN_AI;
            };
        }
    }
}
